<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pages', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('user_id')->default(0)->comment('发布用户id');
            $table->string('title')->default('')->comment('文章名称');
            $table->unsignedInteger('category_id')->default(0)->comment('类型ID');
            $table->string('tags')->default('')->comment('标签');
            $table->longText('content')->comment('内容');
            $table->unsignedInteger('views')->default(0)->comment('浏览次数');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('pages');
    }
}
